package com.xishu.entity.foodPandaOrder;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.annotation.dao.FieldMapping;
import com.xishu.dao.jpa.FeedbackDao;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Lob;
import javax.persistence.Transient;
import javax.persistence.Tuple;
import java.io.Serializable;
import java.util.List;

public class Products implements Serializable {

    private static final long serialVersionUID = -4985664865488195335L;
    @ApiModelProperty(value = "品类名称")
    private String categoryName;

    @ApiModelProperty(value = "产品名称")
    private String name;

    @ApiModelProperty(value = "需要支付的价格")
    private String paidPrice;

    @ApiModelProperty(value = "数量")
    private String quantity;

    @ApiModelProperty(value = "产品在平台上的唯一标识")
    private String id;

    @ApiModelProperty(value = "产品在POS端的唯一标识")
    private String remoteCode;

    @ApiModelProperty(value = "产品单价，不含Topping和税等")
    private String unitPrice;

    @ApiModelProperty(value = "客户备注")
    private String comment;

    @ApiModelProperty(value = "描述，已弃用")
    @DefaultValue(defaultValue = "")
    private String description;

    @ApiModelProperty(value = "已弃用字段")
    @DefaultValue(defaultValue = "")
    private String discountAmount;

    @ApiModelProperty(value = "已弃用，默认false")
    private boolean halfHalf;

    @ApiModelProperty(value = "已弃用字段")
    @DefaultValue(defaultValue = "")
    private String vatPercentage;

    @Transient
    @ApiModelProperty(value = "product里面不一样的选择，不同的variation下面会有不一样的topping选择，我们计划不做多选的variation")
    @FieldMapping(desField = "variationJson", serialize = true)
    private Variation variation;

    @ApiModelProperty(value = "product里面不一样的选择，不同的variation下面会有不一样的topping选择，我们计划不做多选的variation")
    @FieldMapping(desField = "variation", serialize = false, genericType = "com.xishu.entity.foodPandaOrder.Variation")
    private String variationJson;

    @Transient
    @ApiModelProperty(value = "选择topping")
    @FieldMapping(desField = "selectedToppingsJson", serialize = true)
    private List<Topping> selectedToppings;

    @Lob
    @Column(columnDefinition = "MEDIUMTEXT")
    @ApiModelProperty(value = "选择topping")
    @FieldMapping(desField = "selectedToppings", serialize = false, genericType = "com.xishu.entity.foodPandaOrder.Topping")
    private String selectedToppingsJson;

    @ApiModelProperty(value = "已弃用，被Topping取代")
    private List<?> selectedChoices;

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPaidPrice() {
        return paidPrice;
    }

    public void setPaidPrice(String paidPrice) {
        this.paidPrice = paidPrice;
    }

    public String getQuantity() {
        return quantity;
    }

    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }

    public String getRemoteCode() {
        return remoteCode;
    }

    public void setRemoteCode(String remoteCode) {
        this.remoteCode = remoteCode;
    }

    public String getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(String unitPrice) {
        this.unitPrice = unitPrice;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(String discountAmount) {
        this.discountAmount = discountAmount;
    }

    public boolean isHalfHalf() {
        return halfHalf;
    }

    public void setHalfHalf(boolean halfHalf) {
        this.halfHalf = halfHalf;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Variation getVariation() {
        return variation;
    }

    public void setVariation(Variation variation) {
        this.variation = variation;
    }

    public String getVatPercentage() {
        return vatPercentage;
    }

    public void setVatPercentage(String vatPercentage) {
        this.vatPercentage = vatPercentage;
    }

    public List<Topping> getSelectedToppings() {
        return selectedToppings;
    }

    public void setSelectedToppings(List<Topping> selectedToppings) {
        this.selectedToppings = selectedToppings;
    }

    public List<?> getSelectedChoices() {
        return selectedChoices;
    }

    public void setSelectedChoices(List<?> selectedChoices) {
        this.selectedChoices = selectedChoices;
    }

    public String getSelectedToppingsJson() {
        return selectedToppingsJson;
    }

    public void setSelectedToppingsJson(String selectedToppingsJson) {
        this.selectedToppingsJson = selectedToppingsJson;
    }

    public String getVariationJson() {
        return variationJson;
    }

    public void setVariationJson(String variationJson) {
        this.variationJson = variationJson;
    }
}
